*Do file for Senate analysis and results in "On the Decline of Elite-Educated Republicans In Congress," Volden, Craig, Jonathan Wai, and Alan E. Wiseman. Published in Perspectives on Politics

*Use stata dataset: voldenwaiwiseman_senate_perspectives_replication_final.dta

*In the analysis that follows, we have coded elite education as "1" if attended elite undergraduate, graduate, law school and/or business school

* Combining all here

gen elite_education=0
replace elite_education=1 if elite_undergrad_75==1
replace elite_education=1 if elite_grad_75==1
replace elite_education=1 if elite_law==1
replace elite_education=1 if elite_mba==1
label var elite_education "1 = graduated from elite institution"

* Likewise for ivy:

gen ivyany=0
replace ivyany=1 if ivy_undergrad==1
replace ivyany=1 if ivy_grad==1
replace ivyany=1 if ivy_law==1
replace ivyany=1 if ivy_mba==1
label var ivyany "1 = graduated from Ivy League"

* Excluding independents
replace dem = 0.5 if party_code==112
replace dem = 0.5 if party_code==328

* For exploring regional codings
drop south
gen south=0
replace south=1 if state=="OK" | state=="TX" | state=="AR" | state=="LA" | state=="MS" | state=="AL" | state=="TN" | state=="KY" | state=="FL" | state=="GA" | state=="SC" | state=="NC" | state=="VA" | state=="WV" 
gen northeast=0
replace northeast=1 if state=="MD" | state=="DE" | state=="PA" | state=="NJ" | state=="NY" | state=="CT" | state=="RI" | state=="MA" | state=="NH" | state=="VT" | state=="ME" 
gen midwest=0
replace midwest=1 if state=="ND" | state=="SD" | state=="NE" | state=="KS" | state=="MN" | state=="IA" | state=="MO" | state=="WI" | state=="IL" | state=="IN" | state=="MI" | state=="OH" 
gen west=0
replace west=1 if state=="AK" | state=="HI" | state=="WA" | state=="OR" | state=="CA" | state=="MT" | state=="ID" | state=="WY" | state=="NV" | state=="UT" | state=="CO" | state=="AZ" | state=="NM" 


*****************************************
**** MODELS FOR FIGURES PRESENTED IN BODY OF PERSPECTIVES MANUSCRIPT ****
*****************************************
* FIGURE 1: DECLINE OF ELITE-EDUCATED REPUBLICANS IN CONGRESS (FOR SENATE)
sort congress
tab congress elite_education if dem==0, r
tab congress elite_education if dem==1, r


* FIGURE 3: YALE UNDERGRADUATE DEGREES IN THE SENATE, BY PARTY
sort congress
by congress: sum yale_undergrad if dem==1
by congress: sum yale_undergrad if dem==0

* FIGURE 4: ELITE-EDUCATED LAWMAKERS ARE MORE LIBERAL (SENATE MEMBERS)
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)

* COMPARING MAGNITUDE OF EFFECTS
sum dwnom1 if dem==0
* About two-thirds of a standard deviation
* About the same size as for gender in Republican Party

* FIGURE 5: ELITE-EDUCATED REPUBLICANS ARE NO MORE EFFECTIVE (SENATE MEMBERS)
regress lesclassic elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
regress lesclassic elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)

* FOR APPENDIX TABLES

* A1: VARIABLE DESCRIPTIONS, SOURCES, AND SUMMARY STATISTICS
sum elite_education ivyany dwnom1 lesclassic majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct

* A3: IDEOLOGY AND ELITE-EDUCATED LAWMAKERS (SENATE)

* Model A3.1
regress dwnom1 elite_education if dem==0, cluster(bioguide_id)
* Model A3.2
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
* Model A3.3
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq i.congress if dem==0, cluster(bioguide_id)
* Model A3.4
regress dwnom1 elite_education if dem==1, cluster(bioguide_id)
* Model A3.5
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)
* Model A3.6
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq i.congress if dem==1, cluster(bioguide_id)

* A4: ROBUSTNESS OF IDEOLOGY AND ELITE-EDUCATED LAWMAKERS (SENATE)

gener elite_undergrad_university=0
replace elite_undergrad_university= 1 if elite_undergrad_75==1 & elite_las_undergrad==0

gener elite_no_las = 0
replace elite_no_las = 1 if elite_education==1 & elite_las_undergrad==0

gener elite_education_total = elite_undergrad_75+elite_grad_75+elite_law+elite_mba

*replicate ideology analyses for different education variables

*control only for if someone went to an elite undergraduate university (not including LAC)
regress dwnom1 elite_undergrad_university majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
regress dwnom1 elite_undergrad_university majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)

*control only for if someone went to an elite institution--graduate, professional, or undergraduate--other than an elite LAC

regress dwnom1 elite_no_las majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
regress dwnom1 elite_no_las majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)

*control for total number of elite educational experiences (undergraduate plus law/business/graduate--maximum value is three)

regress dwnom1 elite_education_total majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
regress dwnom1 elite_education_total majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)

* A6: ROBUSTNESS OF LIBERAL ELITE-EDUCATED LAWMAKERS RESULTS (SENATE)
* Model A6.1 (midwest as control region)
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq south northeast west if dem==0, cluster(bioguide_id)
* Model A6.2 excluding South
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0 & south==0, cluster(bioguide_id)
* Model A6.3
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq south northeast west if dem==1, cluster(bioguide_id)
* Model A6.4 excluding South
regress dwnom1 elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1 & south==0, cluster(bioguide_id)

* A8: ROBUSTNESS OF IDEOLOGY RESULTS TO IVY LEAGUE-EDUCATED LAWMAKERS (SENATE)
* Model A8.1
regress dwnom1 ivyany if dem==0, cluster(bioguide_id)
* Model A8.2
regress dwnom1 ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
* Model A8.3 
regress dwnom1 ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq i.congress if dem==0, cluster(bioguide_id)
* Model A8.4
regress dwnom1 ivyany if dem==1, cluster(bioguide_id)
* Model A8.5
regress dwnom1 ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)
* Model A8.6
regress dwnom1 ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power female afam latino votepct votepct_sq i.congress if dem==1, cluster(bioguide_id)

* A10: LAWMAKING EFFECTIVENESS OF ELITE-EDUCATED LEGISLATORS (SENATE)
* Model A10.1
regress lesclassic elite_education if dem==0, cluster(bioguide_id)
* Model A10.2
regress lesclassic elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
* Model A10.3 
regress lesclassic elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq i.congress if dem==0, cluster(bioguide_id)
* Model A10.4
regress lesclassic elite_education if dem==1, cluster(bioguide_id)
* Model A10.5
regress lesclassic elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)
* Model A10.6
regress lesclassic elite_education majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq i.congress if dem==1, cluster(bioguide_id)

* A12: ROBUSTNESS OF EFFECTIVENESS RESULTS TO IVY LEAGUE-EDUCATED LAWMAKERS (SENATE)
* Model A12.1
regress lesclassic ivyany if dem==0, cluster(bioguide_id)
* Model A12.2
regress lesclassic ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq if dem==0, cluster(bioguide_id)
* Model A12.3 
regress lesclassic ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq i.congress if dem==0, cluster(bioguide_id)
* Model A12.4
regress lesclassic ivyany if dem==1, cluster(bioguide_id)
* Model A12.5
regress lesclassic ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq if dem==1, cluster(bioguide_id)
* Model A12.6
regress lesclassic ivyany majority seniority sensq state_leg state_leg_prof maj_leader min_leader chair subchr power meddist female afam latino votepct votepct_sq i.congress if dem==1, cluster(bioguide_id)

* A14: ELITE EDUCATION AND VOTE SHARE (SENATE)
gen congcount=congress-93
label var congcount "Congress counter with 93rd Congress set to 0"
* Model A14.1
reg votepct elite_education if dem==0
* Model A14.2
reg votepct i.elite_education##c.congcount if dem==0
* Reelection vote shares no different, and no change over time
* And for Democrats:
* Model A14.3
reg votepct elite_education if dem==1
* Model A14.4
reg votepct i.elite_education##c.congcount if dem==1


* FIGURE A2: DECLINE OF ELITE-EDUCATED REPUBLICANS IN THE SENATE
gener nonelite_nonflagship=0
replace nonelite_nonflagship = 1 if elite_education==0 & flagship_undergrad==0

gener nonelite_flagship = 0
replace nonelite_flagship=1 if flagship_undergrad==1 & elite_education==0

sort congress
tab congress elite_education if dem==0, r
tab congress nonelite_nonflagship if dem==0, r
tab congress nonelite_flagship if dem==0, r

